module.exports = (app)=>{
    return async (req, res, next)=>{
        const inflection = require('inflection')
        const modelName = inflection.classify(req.params.resource)
        req.Model = require(`../models/${modelName}`)
        await next()
    }
}